import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    alias: {
      '@': path.resolve( 'src')
    }
  },
  plugins: [vue()],
  css: {
    preprocessorOptions: {
      less: {
        // https://github.com/vitejs/vite/issues/832
        additionalData: '@import "./src/assets/styles/var.less";',
        modifyVars: {
          '@primary-color': '#1890FF',
          '@menu-collapsed-width': '80px',
          '@text-color': 'rgba(0, 0, 0, .85)'
        },
        javascriptEnabled: true
      }
    }
  },
  server: {
    port: 3000,//启动端口
    proxy: {
      
      "/api": {
        target: 'http://localhost:8088',
        changeOrigin: true,
        rewrite: path => path.replace(/^\/api/, '')
      },
    },
  },
})
